import type { Place } from '@/types/api'

interface SearchPlaceAPIResData {
  count: string
  info: string
  infocode: string
  pois: Place[]
  status: string
}

interface SearchPlaceAPIParams {
  keywords: string
  region: string
}

export function searchPlaceAPI(params: SearchPlaceAPIParams) {
  return mapHttpInstance.get<SearchPlaceAPIResData, SearchPlaceAPIParams>(
    '/v5/place/text',
    { params: {
      key: import.meta.env.VITE_MAP_API_KEY,
      ...params,
    } },
  )
}
